#include "tim.h"
#include "math.h"
#include "string.h"
#include "pwm.h"

void PWM_SetCompare(int ch, int value)
{
	switch(ch)
	{
	case 1:
		__HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1, value);
		break;
	case 2:
		__HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2, value);
		break;
	case 3:
		__HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3, value);
		break;
	case 4:
		__HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4, value);
		break;
	}
}

